#pragma once
namespace Screenshot
{
    struct SCREENSHOT_DESC
    {
        unsigned char * data;
        unsigned int size()
        {
            return width*height*channels;
        };
        void init_data()
        {
            data = new unsigned char[size()];
        }
        unsigned int line_size()
        {
            return width*channels;
        }
        unsigned char * point_data(unsigned int x,unsigned int y)
        {
            return &data[(line_size()*y)+(x*channels)];
        }
        unsigned int width;
        unsigned int height;
        unsigned int channels;
        void release()
        {
            delete[] data;
        }
    };

    void init();
    bool is_init();
    void shutdown();
    SCREENSHOT_DESC cut_frame();
    SCREENSHOT_DESC cut_frame(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
}
